home *** CD-ROM | disk | FTP | other *** search
/ Aminet 7 / Aminet 7 - August 1995.iso / Aminet / docs / misc / ConcNews.lha / news / amiga.programming / comp.sys.amiga.programmer_8965_000049.msg < prev    next >
Encoding:
Internet Message Format  |  1994-11-27  |  1.8 KB

  1. Path: dd.chalmers.se!news.chalmers.se!sunic!EU.net!news.eunet.fi!prime.mdata.fi!mits!rkaivola
  2. From: rkaivola@mits.mdata.fi (Risto Kaivola)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: Removing Task started with CreateNewProc
  5. Date: 12 Apr 1994 10:46:39 +0200
  6. Organization: MITS - Helsinki - Finland
  7. Lines: 34
  8. Message-ID: <rkaivola.766139627@mits>
  9. References: <rknopCo3z57.Azo@netcom.com>
  10. NNTP-Posting-Host: mits.mdata.fi
  11.  
  12. rknop@netcom.com (Robert Knop) writes:
  13.  
  14. >[weird crashes when a parent task is attempting to remove a child
  15. > task in Wait(0L)]
  16.  
  17. >(1) Is RemTask what you are supposed to use to delete AmiagDOS processes, just
  18. >as you do Exec Tasks?  I couldn't find another function that seemed more
  19. >appropriate for getting rid of the task.  (The entry in the AmigaDOS manual
  20. >about CreateNewProc certainly didn't mention anything, but that entry looks
  21. >like it was written by somebody either in a hurry to get it finished, or who
  22. >didn't like typing a whole lot.)
  23.  
  24. I'm not sure exactly what is wrong with your code or the operating
  25. system or the documentation, but I think the following is typically
  26. done when a child task wants to remove itself:
  27.      Forbid();
  28.      RemTask(NULL);
  29.  
  30. The advantage here is that if the child task is executing code
  31. for which the memory was allocated by someone else, this guarantees
  32. that when the allocator of the memory frees the memory, it won't
  33. pull the carpet from under the child.
  34.  
  35. >(2) Is my code that I discuss here likely OK, meaning that I am getting a
  36. >weird problem with something else that corrupts memory or some such?
  37.  
  38. This is just a guess, but it may be that the OS does strange things
  39. when a task executing some critical pieces of code is removed. 
  40.  
  41. >-Rob Knop
  42.  
  43. -- 
  44. Risto Kaivola
  45. (Internet address:   rkaivola@mits.mdata.fi)
  46.